var app = getApp();
Page({
    data: {
        collar: {//领形
            customized_title: "领形",
            selected_customized: "美式领",
            options: [
                {
                    img_url: "http://image.tailorism.com/local/customize/Collar_type/button_dawn_collar.jpg",
                    img_name: "美式领"
                },
                {
                    img_url: "http://image.tailorism.com/local/customize/Collar_type/cutaway_collar.jpg",
                    img_name: "温莎领"
                },
                {
                    img_url: "http://image.tailorism.com/local/customize/Collar_type/hidden_button_collar.jpg",
                    img_name: "暗扣领"
                },
                {
                    img_url: "http://image.tailorism.com/local/customize/Collar_type/honzcntal_collar.jpg",
                    img_name: "伦敦领"
                },
                {
                    img_url: "http://image.tailorism.com/local/customize/Collar_type/round_collar.jpg",
                    img_name: "学院领"
                },
                {
                    img_url: "http://image.tailorism.com/local/customize/Collar_type/square_collar.jpg",
                    img_name: "小方领"
                },
                {
                    img_url: "http://image.tailorism.com/local/customize/Collar_type/stand_collar.jpg",
                    img_name: "中式领"
                },
                {
                    img_url: "http://image.tailorism.com/local/customize/Collar_type/standed_collar.jpg",
                    img_name: "标准领"
                },
                {
                    img_url: "http://image.tailorism.com/local/customize/Collar_type/wing_collar.jpg",
                    img_name: "翼形领"
                }
            ]
        },
        sleeve: {//袖形
            customized_title: "袖形",
            selected_customized: "单扣截角",
            options: [
                {
                    img_url: "http://image.tailorism.com/local/customize/Sleeve/single_button_cut_angle.jpg",
                    img_name: "单扣截角"
                },
                {
                    img_url: "http://image.tailorism.com/local/customize/Sleeve/single_button_rand_angle.jpg",
                    img_name: "单扣圆角"
                },
                {
                    img_url: "http://image.tailorism.com/local/customize/Sleeve/single_button_straight_angle.jpg",
                    img_name: "单扣直角"
                },
                {
                    img_url: "http://image.tailorism.com/local/customize/Sleeve/dou_cut_angle.jpg",
                    img_name: "双扣截角"
                },
                {
                    img_url: "http://image.tailorism.com/local/customize/Sleeve/dou_straight_angle.jpg",
                    img_name: "双扣圆角"
                },
                {
                    img_url: "http://image.tailorism.com/local/customize/Sleeve/dou_straight_straight_angle.jpg",
                    img_name: "双扣直角"
                },
                {
                    img_url: "http://image.tailorism.com/local/customize/Sleeve/french_cut_angle.jpg",
                    img_name: "法式截角"
                },
                {
                    img_url: "http://image.tailorism.com/local/customize/Sleeve/french_round_angle.jpg",
                    img_name: "法式圆角"
                },
                {
                    img_url: "http://image.tailorism.com/local/customize/Sleeve/french_straight_angle.jpg",
                    img_name: "法式直角"
                },
                {
                    img_url: "http://image.tailorism.com/local/customize/Sleeve/short_sleeve.jpg",
                    img_name: "短袖"
                }
            ]
        },
        placket: {//门襟
            customized_title: "门襟",
            selected_customized: "明门襟",
            options: [
                {
                    img_url: "http://image.tailorism.com/local/customize/Placket/frant_strap.jpg",
                    img_name: "明门襟"
                },
                {
                    img_url: "http://image.tailorism.com/local/customize/Placket/flat_strap.jpg",
                    img_name: "平门襟"
                },
                {
                    img_url: "http://image.tailorism.com/local/customize/Placket/hidden_strap.jpg",
                    img_name: "暗门襟"
                }
            ]
        },
        pocket: {//口袋
            customized_title: "口袋",
            selected_customized: "有口袋",
            options: [
                {
                    img_url: "http://image.tailorism.com/local/koudai/wukoudai.jpg",
                    img_name: "无口袋"
                },
                {
                    img_url: "http://image.tailorism.com/local/koudai/youkoudai.jpg",
                    img_name: "有口袋"
                }
            ]
        },
        white_collar_white_sleeves: {//白领白袖
            customized_title: "白领白袖",
            selected_customized: "非白领白袖",
            options: [
                {
                    img_url: "http://image.tailorism.com/local/fblbx.jpg",
                    img_name: "非白领白袖"
                },
                {
                    img_url: "http://image.tailorism.com/local/blbx.jpg",
                    img_name: "白领白袖"
                }
            ]
        },
        live_insert: {//插片
            customized_title: "插片",
            selected_customized: "无插片",
            options: [
                {
                    img_url: "http://image.tailorism.com/local/chapian/wuchapian.jpg?v=22",
                    img_name: "无插片"
                },
                {
                    img_url: "http://image.tailorism.com/local/chapian/huolingchapian.jpg?v=22",
                    img_name: "活领插片"
                },
                {
                    img_url: "http://image.tailorism.com/local/chapian/gudingchapian.jpg?v=3",
                    img_name: "固定插片"
                }
            ]
        },
        waist_dart: {//收腰省
            customized_title: "收腰省",
            selected_customized: "无收腰省",
            options: [
                {
                    img_url: "http://image.tailorism.com/local/ys/wys.jpg",
                    img_name: "无收腰省"
                },
                {
                    img_url: "http://image.tailorism.com/local/ys/yys.jpg",
                    img_name: "要收腰省"
                }
            ]
        },
        xiuzi_list: [//字体
            {
                img_url: "http://image.tailorism.com/local/customize/normal.jpg",
                img_name: "正体"
            },
            {
                img_url: "http://image.tailorism.com/local/customize/swash.jpg",
                img_name: "花体"
            }
        ],
        color_list: [//颜色
            {
                img_url: "http://image.tailorism.com/local/color/顺色.jpg",
                img_name: "顺色"
            },
            {
                img_url: "http://image.tailorism.com/local/color/白色（HTP）.jpg",
                img_name: "白色（HTP）"
            },
            {
                img_url: "http://image.tailorism.com/local/color/黑色(426).jpg",
                img_name: "黑色(426)"
            },
            {
                img_url: "http://image.tailorism.com/local/color/绿色(54).jpg",
                img_name: "绿色(54)"
            },
            {
                img_url: "http://image.tailorism.com/local/color/金色(120).jpg",
                img_name: "金色(120)"
            },
            {
                img_url: "http://image.tailorism.com/local/color/深蓝色(218).jpg",
                img_name: "深蓝色(218)"
            },
            {
                img_url: "http://image.tailorism.com/local/color/品牌蓝色(226).jpg",
                img_name: "品牌蓝色(226)"
            },
            {
                img_url: "http://image.tailorism.com/local/color/酒红色(155).jpg",
                img_name: "酒红色(155)"
            },
            {
                img_url: "http://image.tailorism.com/local/color/大红色(518).jpg",
                img_name: "大红色(518)"
            },
            {
                img_url: "http://image.tailorism.com/local/color/棕色(568).jpg",
                img_name: "棕色(568)"
            },
            {
                img_url: "http://image.tailorism.com/local/color/银灰色(606).jpg",
                img_name: "银灰色(606)"
            }
        ],
        location_list: [//位置
            {
                img_url: "http://image.tailorism.com/local/location/左袖口.jpg",
                img_name: "左袖口"
            },
            {
                img_url: "http://image.tailorism.com/local/location/右袖口.jpg",
                img_name: "右袖口"
            },
            {
                img_url: "http://image.tailorism.com/local/location/左领口.jpg",
                img_name: "左领口"
            },
            {
                img_url: "http://image.tailorism.com/local/location/右领口.jpg",
                img_name: "右领口"
            },
            {
                img_url: "http://image.tailorism.com/local/location/左中腰.jpg",
                img_name: "左中腰"
            },
            {
                img_url: "http://image.tailorism.com/local/location/门襟下摆.jpg",
                img_name: "门襟下摆"
            },
            {
                img_url: "http://image.tailorism.com/local/location/领座内里居中.jpg",
                img_name: "领座内里居中"
            },
            {
                img_url: "http://image.tailorism.com/local/location/左前胸.jpg",
                img_name: "左前胸"
            },
            {
                img_url: "http://image.tailorism.com/local/location/口袋沿.jpg",
                img_name: "口袋沿"
            }
        ],
        constellation_list: [//星座
            {
                img_url: "http://image.tailorism.com/local/xz/Aquarius.jpg",
                img_name: "水瓶座"
            },
            {
                img_url: "http://image.tailorism.com/local/xz/Pisces.jpg",
                img_name: "双鱼座"
            },
            {
                img_url: "http://image.tailorism.com/local/xz/Aries.jpg",
                img_name: "白羊座"
            },
            {
                img_url: "http://image.tailorism.com/local/xz/Taurus.jpg",
                img_name: "金牛座"
            },
            {
                img_url: "http://image.tailorism.com/local/xz/Gemini.jpg",
                img_name: "双子座"
            },
            {
                img_url: "http://image.tailorism.com/local/xz/cancer.jpg",
                img_name: "巨蟹座"
            },
            {
                img_url: "http://image.tailorism.com/local/xz/Leo.jpg",
                img_name: "狮子座"
            },
            {
                img_url: "http://image.tailorism.com/local/xz/Virgo.jpg",
                img_name: "处女座"
            },
            {
                img_url: "http://image.tailorism.com/local/xz/Libra.jpg",
                img_name: "天秤座"
            },
            {
                img_url: "http://image.tailorism.com/local/xz/Scorpio.jpg",
                img_name: "天蝎座"
            },
            {
                img_url: "http://image.tailorism.com/local/xz/Sagittarius.jpg",
                img_name: "射手座"
            },
            {
                img_url: "http://image.tailorism.com/local/xz/Capricorn.jpg",
                img_name: "摩羯座"
            }
        ],
        zodiac_list: [//生肖
            {
                img_url: "http://image.tailorism.com/local/sx/rat.jpg",
                img_name: "鼠"
            },
            {
                img_url: "http://image.tailorism.com/local/sx/ox.jpg",
                img_name: "牛"
            },
            {
                img_url: "http://image.tailorism.com/local/sx/tiger.jpg",
                img_name: "虎"
            },
            {
                img_url: "http://image.tailorism.com/local/sx/rabbit.jpg",
                img_name: "兔"
            },
            {
                img_url: "http://image.tailorism.com/local/sx/dragon.jpg",
                img_name: "龙"
            },
            {
                img_url: "http://image.tailorism.com/local/sx/snake.jpg",
                img_name: "蛇"
            },
            {
                img_url: "http://image.tailorism.com/local/sx/horse.jpg",
                img_name: "马"
            },
            {
                img_url: "http://image.tailorism.com/local/sx/sheep.jpg",
                img_name: "羊"
            },
            {
                img_url: "http://image.tailorism.com/local/sx/monkey.jpg",
                img_name: "猴"
            },
            {
                img_url: "http://image.tailorism.com/local/sx/chicken.jpg",
                img_name: "鸡"
            },
            {
                img_url: "http://image.tailorism.com/local/sx/dog.jpg",
                img_name: "狗"
            },
            {
                img_url: "http://image.tailorism.com/local/sx/pig.jpg",
                img_name: "猪"
            }
        ],
        defaultValue: {
            collar: "",//领形
            sleeve: "",//袖形
            placket: "",//门襟
            pocket: "",//口袋
            white_collar_white_sleeves: "",//白领白袖
            live_insert: "",//插片
            waist_dart: "0",//收腰省
            is_font: "",//是否绣字
            font_content: "",//绣字内容
            font: "",//绣字字体
            font_color: "",//绣字颜色
            font_location: "",//绣字位置
            is_constellation: "",//是否绣星座
            constellation: "",//星座内容
            constellation_color: "",//星座颜色
            constellation_location: "",//星座位置
            is_zodiac: "",//是否绣生肖
            zodiac: "",//生肖内容
            zodiac_color: "",//生肖颜色
            zodiac_location: ""//生肖位置
        },
        sleeve_tips:""
    },//确认以上定制选项
    customized_btn: function () {
        this.updata__customized_detail();
    },//领形
    collar: function (e) {
        var that = this;
        var title = e.currentTarget.dataset.title;
        that.setData({
            "defaultValue.collar": title
        })
    },//袖形
    sleeve: function (e) {
        var that = this;
        var title = e.currentTarget.dataset.title;
        var sleeve_tips ="";
        if (title == "法式圆角" || title == "法式直角" || title == "法式截角"){
            sleeve_tips ="（需搭配袖钉穿着）"
        }
        that.setData({
            "defaultValue.sleeve": title,
            "sleeve_tips": sleeve_tips
        })
    },//门襟
    placket: function (e) {
        var that = this;
        var title = e.currentTarget.dataset.title;
        that.setData({
            "defaultValue.placket": title
        })
    },//口袋
    pocket: function (e) {
        var that = this;
        var title = e.currentTarget.dataset.title;
        that.setData({
            "defaultValue.pocket": title
        })
    },//白领白袖
    white_collar_white_sleeves: function (e) {
        var that = this;
        var title = e.currentTarget.dataset.title;
        that.setData({
            "defaultValue.white_collar_white_sleeves": title
        })
    },//插片
    live_insert: function (e) {
        var that = this;
        var title = e.currentTarget.dataset.title;
        that.setData({
            "defaultValue.live_insert": title
        })
    },//收腰省
    waist_dart: function (e) {
        var that = this;
        var title = e.currentTarget.dataset.title;
        that.setData({
            "defaultValue.waist_dart": title
        })
    },//绣字
    selectXiuzi: function (e) {
        var that = this;
        var title = e.currentTarget.dataset.title;
        var index = e.currentTarget.dataset.index;
        if (title == "不绣字") {
            that.setData({
                "defaultValue.is_font": "不绣字",
                "defaultValue.font": "",
                "defaultValue.font_color": "",
                "defaultValue.font_location": "",
                "defaultValue.font_content": "",
            })
        } else if (title == "绣字") {
            that.setData({
                "defaultValue.is_font": "绣字"
            })
        }
    },//选择字体
    embroidered: function (e) {
        var that = this;
        var title = e.currentTarget.dataset.title;
        that.setData({
            "defaultValue.font": title
        })
    },//选择字体颜色
    font_color: function (e) {
        var that = this;
        var title = e.currentTarget.dataset.title;
        that.setData({
            "defaultValue.font_color": title
        })
    },//选择字体位置
    font_location: function (e) {
        var that = this;
        var title = e.currentTarget.dataset.title;
        that.setData({
            "defaultValue.font_location": title
        })
    },//是否绣星座
    select_constellation: function (e) {
        var that = this;
        var title = e.currentTarget.dataset.title;
        if (title == "不绣花") {
            that.setData({
                "defaultValue.is_constellation": "不绣花",
                "defaultValue.constellation": "",
                "defaultValue.constellation_color": "",
                "defaultValue.constellation_location": ""
            })
        } else if (title == "绣星座") {
            that.setData({
                "defaultValue.is_constellation": "绣星座",
            })
        }
    },//选择星座
    constellation: function (e) {
        var that = this;
        var title = e.currentTarget.dataset.title;
        that.setData({
            "defaultValue.constellation": title
        })
    },//星座颜色
    constellation_color: function (e) {
        var that = this;
        var title = e.currentTarget.dataset.title;
        that.setData({
            "defaultValue.constellation_color": title
        })
    },//星座位置
    constellation_location: function (e) {
        var that = this;
        var title = e.currentTarget.dataset.title;
        that.setData({
            "defaultValue.constellation_location": title
        })
    },//
    select_zodiac: function (e) {
        var that = this;
        var title = e.currentTarget.dataset.title;
        if (title == "不绣花") {
            that.setData({
                "defaultValue.is_zodiac": "不绣花",
                "defaultValue.zodiac": "",
                "defaultValue.zodiac_color": "",
                "defaultValue.zodiac_location": ""
            })
        } else if (title == "绣生肖") {
            that.setData({
                "defaultValue.is_zodiac": "绣生肖"
            })
        }
    },//生肖
    zodiac: function (e) {
        var that = this;
        var title = e.currentTarget.dataset.title;
        that.setData({
            "defaultValue.zodiac": title
        })
    },//生肖颜色
    zodiac_color: function (e) {
        var that = this;
        var title = e.currentTarget.dataset.title;
        that.setData({
            "defaultValue.zodiac_color": title
        })
    },//生肖位置
    zodiac_location: function (e) {
        var that = this;
        var title = e.currentTarget.dataset.title;
        that.setData({
            "defaultValue.zodiac_location": title
        })
    },//绣字内容
    bindKeyInput: function (e) {
        var that = this;
        var value = e.detail.value;
        that.setData({
            "defaultValue.font_content": value
        })
    },
    onLoad: function (options) {
        var that = this;
        var id = options.id;
        var params = {};
        params['cart_id'] = id;
        this.get_customized_detail(params)
        this.setData({
            cart_id: id
        })
    },//获取定制信息
    get_customized_detail: function (params) {
        var that = this;
        wx.request({
            url: app.config() + 'order/getDetailC',
            data: params,
            header: {
                'content-type': 'application/x-www-form-urlencoded'
            },
            success: function (res) {
                var data = res.data.data;
                that.setData({
                    "defaultValue.collar": that.collor_language(data.collar_mode),//领形
                    "defaultValue.sleeve": that.sleeve_language(data.sleeve_mode),//袖形
                    "defaultValue.placket": that.placket_language(data.placket),//门襟
                    "defaultValue.pocket": that.pocket_language(data.pocket),//口袋
                    "defaultValue.white_collar_white_sleeves": that.white_collar_white_sleeves_language(data.white_collar_white_sleeve),//白领白袖
                    "defaultValue.live_insert": data.live_insert,//插片
                    "defaultValue.waist_dart": that.waist_dart_language(data.waist_dart),//收腰省
                    "defaultValue.is_font": that.font_langlage(data.embroidered),//是否绣字
                    "defaultValue.font_content": data.embroidered_text,//绣字内容
                    "defaultValue.font": that.font(data.embroidered_font),//绣字字体
                    "defaultValue.font_color": data.embroidered_color,//绣字颜色
                    "defaultValue.font_location": data.embroidered_location,//绣字位置
                    "defaultValue.is_constellation": that.is_constellation_language(data.constellation),//是否绣星座
                    "defaultValue.constellation": that.constellation_language(data.embroidered_constellation),//星座内容
                    "defaultValue.constellation_color": data.constellation_color,//星座颜色
                    "defaultValue.constellation_location": data.constellation_location,//星座位置
                    "defaultValue.is_zodiac": that.is_zodiac_language(data.zodiac),//是否绣生肖
                    "defaultValue.zodiac": that.zodiac_language(data.embroidered_zodiac),//生肖内容
                    "defaultValue.zodiac_color": data.zodiac_color,//生肖颜色
                    "defaultValue.zodiac_location": data.zodiac_location//生肖位置
                })
                var title = that.data.defaultValue.sleeve;
                var sleeve_tips = "";
                if (title == "法式圆角" || title == "法式直角" || title == "法式截角") {
                    sleeve_tips = "（需搭配袖钉穿着）"
                }
                that.setData({
                    "sleeve_tips": sleeve_tips
                })
            }
        })
    },//领形
    collor_language: function (key) {
        var collor = {
            "standed_collar": "标准领",
            "cutaway_collar": "温莎领",
            "honzcntal_collar": "伦敦领",
            "button_dawn_collar": "美式领",
            "square_collar": "小方领",
            "round_collar": "学院领",
            "wing_collar": "翼形领",
            "stand_collar": "中式领",
            "hidden_button_collar": "暗扣领",
            "other": "其他",
            "标准领": "standed_collar",
            "温莎领": "cutaway_collar",
            "伦敦领": "honzcntal_collar",
            "美式领": "button_dawn_collar",
            "小方领": "square_collar",
            "学院领": "round_collar",
            "翼形领": "wing_collar",
            "中式领": "stand_collar",
            "暗扣领": "hidden_button_collar",
            "其他": "other"
        }
        return collor[key]
    },//袖形
    sleeve_language: function (key) {
        var sleeve = {
            "single_button_cut_angle": "单扣截角",
            "single_button_rand_angle": "单扣圆角",
            "single_button_straight_angle": "单扣直角",
            "dou_cut_angle": "双扣截角",
            "dou_straight_angle": "双扣圆角",
            "dou_straight_straight_angle": "双扣直角",
            "french_cut_angle": "法式截角",
            "french_round_angle": "法式圆角",
            "french_straight_angle": "法式直角",
            "short_sleeve": "短袖",
            "other": "其他",
            "单扣截角": "single_button_cut_angle",
            "单扣圆角": "single_button_rand_angle",
            "单扣直角": "single_button_straight_angle",
            "双扣截角": "dou_cut_angle",
            "双扣圆角": "dou_straight_angle",
            "双扣直角": "dou_straight_straight_angle",
            "法式截角": "french_cut_angle",
            "法式圆角": "french_round_angle",
            "法式直角": "french_straight_angle",
            "短袖": "short_sleeve",
            "其他": "other其他"
        }
        return sleeve[key]
    },//门襟
    placket_language: function (key) {
        var placket = {
            "frant_strap": "明门襟",
            "flat_strap": "平门襟",
            "hidden_strap": "暗门襟",
            "明门襟": "frant_strap",
            "平门襟": "flat_strap",
            "暗门襟": "hidden_strap"
        }
        return placket[key]
    },//口袋
    pocket_language: function (key) {
        var pocket = {
            "0": "无口袋",
            "1": "有口袋",
            "无口袋": "0",
            "有口袋": "1"
        }
        return pocket[key]
    },//白领白袖
    white_collar_white_sleeves_language: function (key) {
        var white_collar_white_sleeves = {
            0: "非白领白袖",
            1: "白领白袖",
            "非白领白袖": "0",
            "白领白袖": "1"
        }
        return white_collar_white_sleeves[key];
    },//收腰省
    waist_dart_language: function (key) {
        var waist_dart = {
            "0": "无收腰省",
            "1": "要收腰省",
            "无收腰省": "0",
            "要收腰省": "1"

        }
        return waist_dart[key];
    },//是否绣字
    font_langlage: function (key) {
        var font = {
            "0": "不绣字",
            "1": "绣字",
            "不绣字": "0",
            "绣字": "1"
        }
        return font[key];
    },//绣字
    font: function (key) {
        var fonts = {
            "swash": "花体",
            "normal": "正体",
            "花体": "swash",
            "正体": "normal"
        }
        return fonts[key]
    },//是否绣星座
    is_constellation_language: function (key) {
        var constellation = {
            "0": "不绣花",
            "1": "绣星座",
            "不绣花": "0",
            "绣星座": "1"
        }
        return constellation[key];
    },//星座
    constellation_language: function (key) {
        var constellation = {
            'Aries': "白羊座",
            'Taurus': "金牛座",
            'Gemini': "双子座",
            'cancer': "巨蟹座",
            'Leo': "狮子座",
            'Virgo': "处女座",
            'Libra': "天秤座",
            'Scorpio': "天蝎座",
            'Sagittarius': "射手座",
            'Capricorn': "摩羯座",
            'Aquarius': "水瓶座",
            'Pisces': "双鱼座",
            '白羊座': "Aries",
            '金牛座': "Taurus",
            '双子座': "Gemini",
            '巨蟹座': "cancer",
            '狮子座': "Leo",
            '处女座': "Virgo",
            '天秤座': "Libra",
            '天蝎座': "Scorpio",
            '射手座': "Sagittarius",
            '摩羯座': "Capricorn",
            '水瓶座': "Aquarius",
            '双鱼座': "Pisces"
        }
        return constellation[key]
    },//是否绣生肖
    is_zodiac_language: function (key) {
        var zodiac = {
            "0": "不绣花",
            "1": "绣生肖",
            "不绣花": "0",
            "绣生肖": "1"
        }
        return zodiac[key];
    },//生肖
    zodiac_language: function (key) {
        var zodiac = {
            "rat": "鼠",
            "ox": "牛",
            "tiger": "虎",
            "rabbit": "兔",
            "dragon": "龙",
            "snake": "蛇",
            "horse": "马",
            "sheep": "羊",
            "monkey": "猴",
            "chicken": "鸡",
            "dog": "狗",
            "pig": "猪",
            "鼠": "rat",
            "牛": "ox",
            "虎": "tiger",
            "兔": "rabbit",
            "龙": "dragon",
            "蛇": "snake",
            "马": "horse",
            "羊": "sheep",
            "猴": "monkey",
            "鸡": "chicken",
            "狗": "dog",
            "猪": "pig",
        }
        return zodiac[key];
    },
    showLoading: function (title) {
        wx.showLoading({
            title: title,
            mask: true,
            icon: "success",
            success: function () {
                setTimeout(function () {
                    wx.hideLoading()
                }, 1500)
            }
        })
    },//更新定制信息
    updata__customized_detail: function (id) {
        var that = this;
        var cart_id = that.data.cart_id;
        var params = {};
        params['cart_id'] = cart_id;//购物车id
        params['collar_mode'] = that.collor_language(that.data.defaultValue.collar)//领形
        params['sleeve_mode'] = that.sleeve_language(that.data.defaultValue.sleeve)//袖形
        params['placket'] = that.placket_language(that.data.defaultValue.placket)//门襟
        params['pocket'] = that.pocket_language(that.data.defaultValue.pocket)//口袋
        params['white_collar_white_sleeve'] = that.white_collar_white_sleeves_language(that.data.defaultValue.white_collar_white_sleeves)//白领白袖
        params['live_insert'] = that.data.defaultValue.live_insert//插片
        params['waist_dart'] = that.waist_dart_language(that.data.defaultValue.waist_dart)//收腰省
        params['embroidered'] = that.font_langlage(that.data.defaultValue.is_font)//是否绣字
        if (that.data.defaultValue.is_font == '绣字') {//绣字
            if (that.data.defaultValue.font_content) {
                params['embroidered_text'] = that.data.defaultValue.font_content//绣字内容
            } else {
                that.showLoading("请填写绣字内容");
                return;
            }
            if (that.data.defaultValue.font) {
                params['embroidered_font'] = that.font(that.data.defaultValue.font)//绣字字体
            } else {
                that.showLoading("请选择绣字字体");
                return;
            }
            if (that.data.defaultValue.font_color) {
                params['embroidered_color'] = that.data.defaultValue.font_color//绣字颜色
            } else {
                that.showLoading("请选择绣字颜色");
                return;
            }
            if (that.data.defaultValue.font_location) {
                params['embroidered_location'] = that.data.defaultValue.font_location//绣字位置
            } else {
                that.showLoading("请选择绣字位置");
                return;
            }
        }
        params['constellation'] = that.is_constellation_language(that.data.defaultValue.is_constellation)//是否绣星座       
        if (that.is_constellation_language(that.data.defaultValue.is_constellation) == "1") {//绣星座 
            if (that.data.defaultValue.constellation) {
                params['embroidered_constellation'] = that.constellation_language(that.data.defaultValue.constellation)//星座内容
            } else {
                that.showLoading("请选择星座内容");
                return;
            }
            if (that.data.defaultValue.constellation_color) {
                params['constellation_color'] = that.data.defaultValue.constellation_color//星座颜色
            } else {
                that.showLoading("请选择星座颜色");
                return;
            }
            if (that.data.defaultValue.constellation_location) {
                params['constellation_location'] = that.data.defaultValue.constellation_location//星座位置
            } else {
                that.showLoading("请选择星座位置");
                return;
            }
        }
        params['zodiac'] = that.is_zodiac_language(that.data.defaultValue.is_zodiac)//是否绣生肖
        if (that.is_zodiac_language(that.data.defaultValue.is_zodiac) == "1") {//绣生肖
            if (that.data.defaultValue.zodiac) {
                params['embroidered_zodiac'] = that.zodiac_language(that.data.defaultValue.zodiac)//生肖内容
            } else {
                that.showLoading("请选择生肖内容");
                return;
            }
            if (that.data.defaultValue.zodiac_color) {
                params['zodiac_color'] = that.data.defaultValue.zodiac_color//生肖颜色
            } else {
                that.showLoading("请选择生肖颜色");
                return;
            }
            if (that.data.defaultValue.zodiac_location) {
                params['zodiac_location'] = that.data.defaultValue.zodiac_location//生肖位置
            } else {
                that.showLoading("请选择生肖位置");
                return;
            }
        }
        that.showLoading("提交成功");
        wx.request({
            url: app.config() + 'order/updateDetailC',
            data: params,
            header: {
                'content-type': 'application/json'
            },
            success: function (res) {
                wx.navigateBack({
                    delta:1
                })
                setTimeout(function () {
                    wx.hideLoading()
                }, 5000)
            }
        })
    }
})